package com.wwg.design.patten.observer.case1;

/**
 * @类描述: TODO
 * @Author wwg
 * @date: 2021/7/21 10:32
 * @Version: 1.0
 **/
public class ObserverDPTest {
    public static void main(String[] args) {
        // 新建一个主体
         ISubject subject = new Subject("太阳Vs雄鹿");

         // 订阅者 （观察者）
        IObserver observerDan = new Observer("张铁蛋");
        IObserver observerDog = new Observer("李二狗");
        IObserver observerLang = new Observer("黄四郎");

        // 订阅主题
        subject.addObserver(observerDan,observerDog,observerLang);

        subject.someThingHappen("my son sun ,赢了！");


    }
}
